package com.mightybird.designpattern.structural.composite.safe.container;

import com.mightybird.designpattern.structural.composite.safe.SafeComponent;
import com.mightybird.designpattern.structural.composite.safe.SafeContainer;

public class SWindow extends SafeContainer {
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public SWindow(String name) {

        this.name = name;
    }

    @Override
    public void operation() {
        System.out.println("Open " + name + " SWindow");
        children.forEach(SafeComponent::operation);
    }
}
